﻿using System.Windows.Forms;

namespace ThreadSafeControls {
    public class ThreadSafeTreeView : ThreadSafeControl<TreeView> {

        protected readonly ThreadSafeTreeNodeCollection _nodes;

        internal ThreadSafeTreeView(TreeView treeView) : base(treeView) {
            _nodes = new ThreadSafeTreeNodeCollection(treeView.Nodes, this);
        }

        public ThreadSafeTreeNodeCollection Nodes {
            get { return _nodes; }
        }

        public void Sort() {
            UpdateAsync(c => c.Sort());
        }

    }
}
